package expansion.recursion;
/**
 * 递归解决阶乘问题
 */
public class Factorial {
    public static void main(String[] args) {
        System.out.println(factorialRecursion(5));
    }

    static int factorialRecursion(int n){
        int sum = 0;
        if (n==1){
            return n;
        }
        sum = n * factorialRecursion(n-1);
        return sum;
    }
}
